package fr.utbm.gi.in56.ads;

import java.util.Date;

/**
 * Implementation of an ad of type sell.
 * 
 * @author Adrien Hoffer & Tarik Belabbas
 *
 */
public class AdSell extends Ad
{		
	/**
	 * The year of entry into service of the car
	 */
	private int		vehicle_year;
	
	/**
	 * The number of kilometers of the vehicle sold in the ad
	 */
	private int 	kmNb;
	
	/**
	 * The price of the car
	 */
	private int 	price;
	
	/**
	 * <tt>true</tt> if the ad has a corresponding image
	 */
	private boolean hasImage;

	/**
	 * Parameterized constructor
	 */
	public AdSell(int _id, Date _adDate, int _adState, String _title, int _idBrand,
			String _brand, int _idModel, String _model, String _description, int _idEnergy,
			String _energy, int _isAutomatic, boolean _isChecked, String _loginBuyer,
			String _loginSeller, int _userCounty, int _userRate, int _vehicleYear,
			int _kmNb, int _price, boolean _hasImage)
	{
		super(_id, _adDate, _adState, _title, _idBrand,_brand, _idModel, _model,
				_description, _idEnergy, _energy, _isAutomatic, _isChecked, _loginBuyer,
				_loginSeller, _userCounty, _userRate);
		
		this.vehicle_year 	= _vehicleYear;
		this.kmNb 			= _kmNb;
		this.price 			= _price;
		this.hasImage 		= _hasImage;
	}
	
	/**
	 * Default constructor
	 */
	public  AdSell()
	{
		super();
		this.hasImage = false;
		this.price = -1;
		this.kmNb = -1;
		this.vehicle_year = 0;
	}
	
	/**
	 * Sets the vehicle year
	 *
	 * @param vehicle_year the vehicle_date to set
	 */
	public void setVehicle_date( int vehicle_year )
	{
		this.vehicle_year = vehicle_year;
	}

	/**
	 * Returns the vehicle year
	 *
	 * @return the vehicle_year
	 */
	public int getVehicle_date()
	{
		return this.vehicle_year;
	}

	/**
	 * Sets the number of kilometers
	 *
	 * @param kmNb the kmNb to set
	 */
	public void setKmNb( int kmNb )
	{
		this.kmNb = kmNb;
	}

	/**
	 * Returns the number of kilometers
	 *
	 * @return the kmNb
	 */
	public int getKmNb()
	{
		return this.kmNb;
	}

	/**
	 * Sets the price of the car
	 *
	 * @param price the price to set
	 */
	public void setPrice( int price )
	{
		this.price = price;
	}

	/**
	 * Returns the price of the car
	 *
	 * @return the price
	 */
	public int getPrice()
	{
		return this.price;
	}

	/**
	 * Sets the boolean corresponding to the image of an add
	 *
	 * @param hasImage the hasImage to set
	 */
	public void setHasImage( boolean hasImage )
	{
		this.hasImage = hasImage;
	}

	/**
	 * Returns <tt>true</tt> if the ad has an image
	 *
	 * @return the hasImage
	 */
	public boolean isHasImage()
	{
		return this.hasImage;
	}
	
}
